package com.example.designPattern.Delegate.Simple;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

/*
 * @Project:gupaoedu.vip.DesignPattern.Delegate.Simple
 * @Creator:Administrator
 * @Description:
 * @Date Created in 21:04 2019/3/13
 */
public class Leader {
    private Map<String,IEmployee> map = new ConcurrentHashMap<>();

    public  Leader(){
        map.put("demand",new EmployGP1008());
        map.put("frame",new EmployGP1009());
        map.put("docode",new EmployGP1019());
    }
    public void  dosomething(String command){
         IEmployee iEmployee= map.get(command);
         if(iEmployee==null){
             System.out.println("Boos,需要招人干活！");
             return;
         }
         iEmployee.dosomething();
    }
}
